package com.eastfair.common.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.core.base.R;
import com.eastfair.pay.dto.ApplyRefundDTO;
import com.eastfair.pay.dto.ApplyRefundPageQuery;
import com.eastfair.pay.dto.RefundDTO;
import com.eastfair.pay.vo.ApplyRefundVO;
import feign.Request;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "mice-pay/applyRefund")
public interface ApplyRefundFeign {

    /**
     * 结算列表退款确认 场馆预定用
     */
    @PostMapping("/saveApplyRefund")
    R saveApplyRefund(ApplyRefundDTO applyRefundDTO);

    /**
     * @return com.eastfair.core.base.R
     * @Author clm
     * @Description //接受退款申请
     * @Date 14:19 2023/2/20
     * @Param [applyRefundDTO]
     **/
    @PostMapping("/acceptApplyRefund")
    R acceptApplyRefund(@RequestBody ApplyRefundDTO applyRefundDTO, Request.Options options);

    /**
     * @return com.eastfair.core.base.R
     * @Author clm
     * @Description //更新退款申请
     * @Date 14:37 2023/2/20
     * @Param [applyRefundDTO]
     **/
    @PostMapping("/updateApplyRefund")
    R updateApplyRefund(@RequestBody ApplyRefundDTO applyRefundDTO);

    /**
     * 退款管理查询
     *
     * @return
     */
    @PostMapping("/queryList")
    R<Page<ApplyRefundVO>> queryList(@RequestBody @Validated PageParams<ApplyRefundPageQuery> params);

    /**
     * 退款详情查询
     *
     * @param applyRefundId
     * @return
     */
    @GetMapping("applyRefundQueryById")
    R<ApplyRefundVO> applyRefundQueryById(@RequestParam("applyRefundId") Long applyRefundId);

    /**
     * 确认退款
     */
    @PostMapping("/saveApplyRefundCnfirm")
    R saveApplyRefundCnfirm(@RequestBody ApplyRefundDTO applyRefundDTO);

    /**
     * 通过业务主键集合查询发票申请状态集合
     *
     * @param buinessIds
     * @return
     */
    @PostMapping("/queryExamineState/buinessIds")
    R<List<ApplyRefundVO>> queryRefundExamineState(@RequestBody List<Long> buinessIds);

    /**
     * 银联在线退款
     *
     * @param dto
     * @return
     */
    @PostMapping("/online")
    R<Boolean> onlineRefund(@RequestBody RefundDTO dto);
}
